---
title: "Row Grouping"
description: "Enable row grouping in the $framework Data Grid to allow rows to be grouped by columns. Define row groups, use the Grid API, or use the UI to group rows."
enterprise: true
---
The Grid can group rows with equivalent cell values under shared parent rows.

{% gridExampleRunner title="Kitchen Sink" name="kitchen-sink" /%}

## Enabling Row Grouping

Row Grouping is enabled by setting `rowGroup` to `true` on one or more [Column Definition](./column-definitions/).
Group rows are then introduced for each unique value in that column, containing the rows with that value.

The example above uses the following configuration to group rows by their `country` and `year` values:
```{% frameworkTransform=true %}
const gridOptions = {
    columnDefs: [
        { field: 'country', rowGroup: true },
        { field: 'sport', rowGroup: true },
        // ...other column definitions
    ],
}
```

## API Reference

{% note %}
The row grouping state can be saved and restored as part of [Grid State](./grid-state/).
{% /note %}

{% apiDocumentation source="grid-options/properties.json" section="rowGrouping" /%}

## Next Up

Continue to the next section to learn about [Grouping Data](./grouping-data/).
